package com.fhz.day007.server;

import androidx.lifecycle.LiveData;

import com.fhz.day007.entity.Category;
import com.fhz.day007.entity.User;
import com.fhz.utilsfhz.ApiResponse;

import java.util.List;

import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * 时间:2022/5/25
 *
 * @author msfeng
 * 简述: TODO
 */
public interface ShopApi {

     String BASE_URL = "http://www.fenghongzhang.com:9999/";

    @GET("/category/getType")
    LiveData<ApiResponse<List<Category>>> getCategory(@Query("type") int type);


    @POST("/123")
    @FormUrlEncoded
    LiveData<ApiResponse<List<Category>>> getFood(
            @Field("nickname") String name
            ,@Field("password") String pwd);


    @POST("/123")
    @FormUrlEncoded
    LiveData<ApiResponse<List<Category>>> getFood1(@Body User user);


}
